require("lib/my")


LinkLuaModifier("modifier_atr_fix", "modifiers/modifier_atr_fix.lua", LUA_MODIFIER_MOTION_NONE)
LinkLuaModifier("modifier_melee_gift", "modifiers/modifier_atr_fix.lua", LUA_MODIFIER_MOTION_NONE)

-- Fixes the magic res str gives. Check if it is a hero before calling.
function fix_atr_for_hero(hero)
    local fix_mod = "modifier_atr_fix"
    local melee_gift = "modifier_melee_gift"

    if not hero:HasModifier(fix_mod) then
        hero:AddNewModifier(hero, nil, fix_mod, {})
    end
    -- if not hero:HasModifier(melee_gift) and hero:GetAttackCapability() == DOTA_UNIT_CAP_MELEE_ATTACK then
    --     hero:AddNewModifier(hero, nil, melee_gift, {})
    -- end
end
